home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / NRS.H < prev    next >
C/C++ Source or Header  |  1988-03-19  |  1KB  |  32 lines

  1. /* SLIP definitions */
  2. #define    NRS_ALLOC    40    /* Receiver allocation increment */
  3.  
  4. #define STX    0x02        /* frame start */
  5. #define ETX 0x03        /* frame end */
  6. #define DLE    0x10        /* data link escape */
  7. #define NUL 0x0            /* null character */
  8.  
  9. /* packet unstuffing state machine */
  10. #define NRS_INTER    0        /* in between packets */
  11. #define NRS_INPACK    1        /* we've seen STX, and are in a the packet */
  12. #define NRS_ESCAPE    2        /* we've seen a DLE while in NRS_INPACK */
  13. #define NRS_CSUM    3        /* we've seen an ETX, and are waiting for the checksum */
  14.  
  15. /* net/rom serial protocol control structure */
  16. struct nrs {
  17.     struct mbuf *sndq;    /* Encapsulated packets awaiting transmission */
  18.     int16 sndcnt;        /* Number of datagrams on queue */
  19.     char state;            /* Receiver State control flag */
  20.     unsigned char csum;    /* Accumulating checksum */
  21.     struct mbuf *rbp;    /* Head of mbuf chain being filled */
  22.     struct mbuf *rbp1;    /* Pointer to mbuf currently being written */
  23.     char *rcp;            /* Write pointer */
  24.     int16 rcnt;            /* Length of mbuf chain */
  25.     struct mbuf *tbp;    /* Transmit mbuf being sent */
  26.     long errors;        /* Checksum errors detected */
  27.     long packets ;        /* Number of packets received successfully */
  28.     struct interface *iface ;    /* Associated interface structure */
  29. };
  30.  
  31. extern struct nrs nrs[];
  32.